From 007ba3bc14b690f32f269770ec6a52c7c6a561a5 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 4 Aug 2014 14:21:59 +0200 Subject: [PATCH] GtkSwitch: End animation in set_active End any running toggle animation before setting the set, otherwise things get confused. --- gtk/gtkswitch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c index 915dc3899f..534dc5834a 100644 --- a/gtk/gtkswitch.c +++ b/gtk/gtkswitch.c @@ -160,7 +160,6 @@ gtk_switch_on_frame_clock_update (GdkFrameClock *clock, } else { - gtk_switch_end_toggle_animation (sw); gtk_switch_set_active (sw, !priv->is_active); priv->handle_x = priv->dest_offset; } @@ -1075,6 +1074,8 @@ gtk_switch_set_active (GtkSwitch *sw, g_return_if_fail (GTK_IS_SWITCH (sw)); + gtk_switch_end_toggle_animation (sw); + is_active = !!is_active; priv = sw->priv; -- 2.30.2